const mongoose = require('mongoose');//引入mongoose
require('./questionsModel');
require('./userModel')

const errorSchema = new mongoose.Schema({
    ErrorAnswer: String,
    errorQuestions_id: {
        type: mongoose.SchemaTypes.ObjectId,
        //关联集合模型，集合模型名在mongoose.model注册的名字
        ref:'questionsModel'
    },
    user_id:{
        type: mongoose.SchemaTypes.ObjectId,
        //关联集合模型，集合模型名在mongoose.model注册的名字
        ref:'userModel'

    }
});

const errorModel = mongoose.model("errorModel", errorSchema, "ErrorQuestions");
module.exports = {errorModel}